package com.java.controller;

import com.java.dao.SparePartsDao;
import com.java.entity.SpareParts;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * 备件(SpareParts)表控制层
 *
 * @author 安能
 * @since 2020-07-01 11:27:58
 */
@RestController
@RequestMapping("SpareParts")
public class SparePartsController {



    @Resource
    private SparePartsDao sparePartsDao;



    @GetMapping("selectList")
    public HashMap<String, Object> selectList() {
        List<SpareParts> spareParts = sparePartsDao.selectList(null);
        HashMap<String, Object> map = new HashMap<>();
        map.put("code", 0);
        map.put("msg", "");
        map.put("count", spareParts.size());
        map.put("data", spareParts);
        return map;
    }
}